<%- include fheader.ejs%>
<style>
    body{background: #f8f8f8}
    .ranking{
        display: flex;
        align-items: center;
        width: 30px;
    }
    .blue{color:#00a5e0}
    .ui-txt-info{
        font-size: 12px;
    }
    .ui-txt-info span{
        font-size: 20px;
        padding: 0 3px;
    }
    li.me-first .ui-txt-info{
        color:#00a5e0
    }
</style>
<section  class="ui-container"  style="margin-bottom: 60px">
    <div class="ui-tab">
        <ul class="ui-tab-nav ui-border-b">
            <li class="current">个人</li>
            <li>门店</li>
        </ul>
        <div style="height: 15px;background: #f8f8f8;"></div>
        <ul class="ui-tab-content" style="width:300%">
            <li class="current">
                <ul class="ui-list ui-list-one ui-border-tb" id="personSaleRankList">
                    <li class="ui-border-t me-first"></li>
                    <li style="height: 10px;background: #f8f8f8;margin-left: -15px"></li>
                    <% for(var i in emprank) {
                    if(empid==emprank[i].emp_id){ %>
                    <li class="ui-border-t me">
                        <div class="ranking"><%=emprank[i].pm%></div>
                        <div class="ui-list-info">
                            <div class="ui-avatar">
                                <span style="background-image:url(<%=emprank[i].avatar%>)"></span>
                            </div>
                            <h4 class="ui-nowrap">
                                <%=emprank[i].rname%>
                                <p style="margin-top: -20px;font-size: 12px"><%=emprank[i].cname%></p>
                            </h4>
                            <div class="ui-txt-info ui-txt-highlight">已销售<span><%=emprank[i].cc%></span>笔</div>
                        </div>
                    </li>
                    <%}else{%>
                    <li class="ui-border-t">
                        <div class="ranking"><%=emprank[i].pm%></div>
                        <div class="ui-list-info">
                            <div class="ui-avatar">
                                <span style="background-image:url(<%=emprank[i].avatar%>)"></span>
                            </div>
                            <h4 class="ui-nowrap">
                                <%=emprank[i].rname%>
                                <p style="margin-top: -20px;font-size: 12px"><%=emprank[i].cname%></p>
                            </h4>
                            <div class="ui-txt-info ui-txt-highlight">已销售<span><%=emprank[i].cc%></span>笔</div>
                        </div>
                    </li>
                    <%}}%>
                </ul>
            </li>

            <li>
                <ul class="ui-list ui-list-one ui-border-tb" id="storeSaleRankList">
                    <li class="ui-border-t me-first"></li>
                    <li style="height: 10px;background: #f8f8f8;margin-left: -15px"></li>
                    <% for(var i in orgrank) {
                    if(channel_id==orgrank[i].channel_id){ %>
                    <li class="ui-border-t me">
                        <div class="ranking"><%=orgrank[i].pm%></div>
                        <div class="ui-list-info">
                            <h4 class="ui-nowrap"><%=orgrank[i].rname%></h4>
                            <div class="ui-txt-info ui-txt-highlight">已销售<span><%=orgrank[i].cc%></span>笔</div>
                        </div>
                    </li>
                    <%}else{%>
                    <li class="ui-border-t">
                        <div class="ranking"><%=orgrank[i].pm%></div>
                        <div class="ui-list-info">
                            <h4 class="ui-nowrap"><%=orgrank[i].rname%></h4>
                            <div class="ui-txt-info ui-txt-highlight">已销售<span><%=orgrank[i].cc%></span>笔</div>
                        </div>
                    </li>
                    <%}}%>
                </ul>
            </li>
        </ul>
    </div>

</section>
<%- include navbar.ejs%>


<script>
    $(function(){
        userId = "003";
        var tab = new fz.Scroll('.ui-tab', {
            role: 'tab',
            autoplay: false,
            interval: 3000
        });

        $('#personSaleRankList li.me-first').html($('#personSaleRankList li.me').html());

        $('#storeSaleRankList li.me-first').html($('#storeSaleRankList li.me').html());
//        $.ajax({
//            url:"test/tsconfig.json",
//            type:"get",
//            dataType:"json",
//            success:function (data) {
//                var rankList = data;
//                var personRankList = $.tpl($('#personlist').html(),rankList);
//                var storeRankList = $.tpl($('#storelist').html(),rankList);
//                $('#personSaleRankList').append(personRankList);
//                $('#storeSaleRankList').append(storeRankList);
//                $('#personSaleRankList li.me-first').html($('#personSaleRankList li.me').html());
//                $('#storeSaleRankList li.me-first').html($('#storeSaleRankList li.me').html())
//            },
//            error:function () {
//                $.dialog('请求服务器错误')
//            }
//        });

    })
</script>